package cn.zwk.control;

import cn.zwk.common.to.es.SkuEsModel;
import cn.zwk.common.utils.R;
import cn.zwk.service.SaveService;
import com.alibaba.fastjson2.JSON;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/search/save")
@Slf4j
public class ElasticSaveControl {

    @Autowired
    private SaveService saveService;

    @RequestMapping("/product")
    public R productStatusUp(@RequestBody List<SkuEsModel> skuEsModels) {
        saveService.saveProduct(skuEsModels);
        return R.ok();
    }
}
